package com.qf.service.impl;

import com.qf.mapper.ShoppingCartMapper;
import com.qf.pojo.ShoppingCart;
import com.qf.service.ShoppingCartService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author 87380
 * @date 2021/12/8
 */
@Service
public class ShoppingCartServiceImpl implements ShoppingCartService {

    @Resource
    private ShoppingCartMapper shoppingCartMapper;

    @Override
    public List<ShoppingCart> shoppingCartListByUserId(Integer id) {

        return shoppingCartMapper.shoppingCartListByUserId(id);
    }

    @Override
    public int deleteByCartId(List<Integer> ids) {
        return shoppingCartMapper.deleteBatchIds(ids);
    }

    @Override
    public int putProduct(ShoppingCart shoppingCart) {
        return shoppingCartMapper.insert(shoppingCart);
    }
}
